#include <gtest/gtest.h>
#include <QDataStream>

// This test is failded.
TEST(Functional, QDataStream_read_and_write)
{
	QByteArray buffer;
	QDataStream s(&buffer, QIODevice::ReadWrite);

	QString input = "Test string";
	s << input;
	QString directOutput;
	s >> directOutput;
	EXPECT_NE(input, directOutput);
	EXPECT_EQ(QString(), directOutput);

	QDataStream ins(buffer);
	QString newStreamOutput;
	ins >> newStreamOutput;
	EXPECT_EQ(input, newStreamOutput);
}